<template>
    <div class="fillcontain">
        <div class="table_container">
            <el-table
                :data="tableData"
                style="width: 100%">
                <el-table-column
                  label="id"
                  prop="id">
                </el-table-column>
                <el-table-column
                  label="卖家名称"
                  prop="userName">
                </el-table-column>
                <el-table-column
                  label="账号"
                  prop="userAccount">
                </el-table-column>
                <el-table-column label="操作" width="200">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleac(scope.$index, scope.row)">接受</el-button>
                  </template>
                </el-table-column>
            </el-table>
            <div class="Pagination">
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage"
                  :page-size="10"
                  layout="total, prev, pager, next"
                  :total="count">
                </el-pagination>
            </div>

        </div>
    </div>
</template>

<script>

    export default {
        data(){
            return {

                city: {},
                offset: 0,
                limit: 10,
                count: 0,
                tableData: [],
                currentPage: 1,
                selectTable: {},
                dialogFormVisible: false,
                categoryOptions: [],
                selectedCategory: [],
                address: {},
            }
        },
        created(){
         this.getdata();
        },
        methods: {
            handleac(index,row)
            {
               console.log(row.id);
              let config = {
                headers: {
                  "tokenValue":this.$store.getters.getUser
                }
              }
                axios.post('http://myphoenixshop.cpolar.io/updateApplicationStatus',{
                    id:row.id,
                    state:2
                },config).then(res=>{
                    console.log(res);
                    console.log(row.id);
                })
            },
            getdata(){
              let config = {
                headers: {
                  "tokenValue":this.$store.getters.getUser
                }
              }
                axios.post('http://myphoenixshop.cpolar.io/getApplicationsPage',
                    {"pageNum":this.currentPage,"pageSize":this.limit},
                    config
                ).then(res=>{
                    console.log(res);
                    this.tableData=res.data.data.content;
                    this.count=res.data.data.totalSize;
                    console.log(this.count);


                })
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                this.currentPage = val;
                this.getdata()
            },

        },
    }
</script>

<style lang="less">
	@import '../style/mixin';
    .demo-table-expand {
        font-size: 0;
    }
    .demo-table-expand label {
        width: 90px;
        color: #99a9bf;
    }
    .demo-table-expand .el-form-item {
        margin-right: 0;
        margin-bottom: 0;
        width: 50%;
    }
    .table_container{
        padding: 20px;
    }
    .Pagination{
        display: flex;
        justify-content: flex-start;
        margin-top: 8px;
    }
    .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }
    .avatar-uploader .el-upload:hover {
        border-color: #20a0ff;
    }
    .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 120px;
        height: 120px;
        line-height: 120px;
        text-align: center;
    }
    .avatar {
        width: 120px;
        height: 120px;
        display: block;
    }
</style>
